package com.ucode.model.hrm.enums;

import com.ucode.tool.base.IntArrayValuable;

import java.util.Arrays;

/**
 * 雇佣类型枚举类
 * @author liliang
 * @date: 2019年12月6日 上午11:05:25
 */
public enum HrmEmploymentTypeEnum implements IntArrayValuable {

    INTERN(1, "实习"),
    PROBATION(2, "试用"),
    FULL_TIME(3, "正式"),
    LEFT(4, "离职"),
    APPLY(10, "入职申请");

    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(HrmEmploymentTypeEnum::getCode).toArray();

    public Integer code;

    public String message;

    HrmEmploymentTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    
    public static HrmEmploymentTypeEnum get(Integer code){
        for(HrmEmploymentTypeEnum dataPermissionType : values()){
            if(dataPermissionType.code == code){
                return dataPermissionType;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int[] array() {
        return ARRAYS;
    }
}